﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.Web;

namespace Model
{

    [MetadataType(typeof(TimeCard_Metadata))]
    [DisplayName("考勤信息")]
    public partial class TimeCard
    {
        public TimeCard()
        {
            this.Id = Guid.NewGuid();
            this.AddDate = DateTime.Now;
            this.WorkTime = DateTime.Now.TimeOfDay;
            this.AfterWorkTime = DateTime.Now.TimeOfDay;
            this.UserId = new Guid(HttpContext.Current.User.Identity.Name);
        }

        public class TimeCard_Metadata
        {
            [ScaffoldColumn(false)]
            public System.Guid Id { get; set; }

            [DisplayName("用户")]
            [DropDownList("Sys_Users", "Id", "UserName")]
            public System.Guid UserId { get; set; }

            [DisplayName("添加日期")]
            public object AddDate { get; set; }

            [DisplayName("上班时间")]
            public object WorkTime { get; set; }

            [DisplayName("下班时间")]
            public object AfterWorkTime { get; set; }

            [DisplayName("备注")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Note { get; set; }
        }
    }
}
